#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve() {
	int n, m;
	cin >> n >> m;

	ll ans = (n - 1) * m + (m - 1) * n;

	cout << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
	return 0;
}